﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Model.DataContext;
using Model.Object;
namespace Nongsan.Controllers
{
    public class ViewHelperController : Controller
    {
        //
        // GET: /ViewHelper/
        private DataContext db = new DataContext();

        public ActionResult Banner()
        {
            var banner = db.Banners.ToList<Banner>();
            return PartialView(banner);
        }
        public ActionResult DanhSachNhom_SanPham()
        {
            ViewBag.nhom = db.Nhoms.ToList<Nhom>();
            ViewBag.loai = db.LoaiSanPhams.ToList<LoaiSanPham>();
            ViewBag.sanpham = db.SanPhams.ToList<SanPham>();
            return PartialView();
        }
     

        public ActionResult Menus()
        {
            ViewBag.nhom = db.Nhoms.ToList<Nhom>();
            
            ViewBag.loaisanpham = db.LoaiSanPhams.ToList<LoaiSanPham>();

            return PartialView();
        }

        public ActionResult Linktop()
        {
            ViewBag.config = db.WebConfigs.FirstOrDefault();
            return PartialView();
        }

        public ActionResult BottomArea()
        {
            ViewBag.config = db.WebConfigs.FirstOrDefault();
            return PartialView();
        }

        public ActionResult ListTinTuc()
        {
            ViewBag.lsttintuc = (from n in db.TinTucs select n).ToList<TinTuc>();
            return PartialView();
        }

        public ActionResult GeneralMenus()
        {
            return PartialView();
        }
        [Authorize]
        public ActionResult UserPanel()
        {
            return PartialView();
        }

        public ActionResult Giotrong()
        {
            return PartialView();
        }

        public ActionResult Sanphammuamini(SanPham sp)
        {
            ViewBag.kq = sp;
            return PartialView();
        }
    }
}
